package com.example.elastic.repository;

import com.example.elastic.document.Menu;
import com.example.elastic.document.User;
import org.springframework.data.elasticsearch.annotations.Query;
import org.springframework.data.repository.CrudRepository;

import java.util.List;

/**
 * @author zxs
 * @since 2022/4/20
 */
public interface MenuRepository extends CrudRepository<Menu,Integer> {


    @Query("""
            {
              "simple_query_string":{
                "query":"?0",
                "fields":["path"]
              }
            }
            """)
    List<Menu> customQuery(String path);
}
